import matplotlib.pyplot as plt
import numpy as np

if __name__ == "__main__":
    
    
    # task = sys.argv[1]
    task = "rotation"
    
    backLowerLeg = np.load(f"logs/{task}-BackLeg_BackLowerLeg.npy")
    backUpperLeg = np.load(f"logs/{task}-Torso_BackLeg.npy")
    frontLowerLeg = np.load(f"logs/{task}-FrontLeg_FrontLowerLeg.npy")
    frontUpperLeg = np.load(f"logs/{task}-Torso_FrontLeg.npy")
    leftLowerLeg = np.load(f"logs/{task}-LeftLeg_LeftLowerLeg.npy")
    leftUpperLeg = np.load(f"logs/{task}-Torso_LeftLeg.npy")
    rightLowerLeg = np.load(f"logs/{task}-RightLeg_RightLowerLeg.npy")
    rightUpperLeg = np.load(f"logs/{task}-Torso_RightLeg.npy")
    
    plt.figure(figsize=(16, 8))
    
    ax = plt.subplot(4, 2, 1)
    ax.plot(backLowerLeg[:1000])
    ax = plt.subplot(4, 2, 2)
    ax.plot(backUpperLeg[:1000])
    ax = plt.subplot(4, 2, 3)
    ax.plot(frontLowerLeg[:1000])
    ax = plt.subplot(4, 2, 4)
    ax.plot(frontUpperLeg[:1000])
    ax = plt.subplot(4, 2, 5)
    ax.plot(leftLowerLeg[:1000])
    ax = plt.subplot(4, 2, 6)
    ax.plot(leftUpperLeg[:1000])
    ax = plt.subplot(4, 2, 7)
    ax.plot(rightLowerLeg[:1000])
    ax = plt.subplot(4, 2, 8)
    ax.plot(rightUpperLeg[:1000])
    
    plt.show()
